package com.apex.crm.utils;

import org.apache.commons.lang3.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author XiaoYang
 * @version 1.0
 * @program: crm
 * @Classname PhoneUtil
 * @description TODO
 * @date 2021/4/22 16:14
 */

public class PhoneUtil {

    public static boolean isMobile(String phone){
        Pattern pattern = null;
        Matcher matcher = null;
        boolean b = false;
        String s2="^[1](([3|5|8][\\d])|([4][4,5,6,7,8,9])|([6][2,5,6,7])|([7][^9])|([9][1,8,9]))[\\d]{8}$";
        if(StringUtils.isNotBlank(phone)){
            pattern =  Pattern.compile(s2);
            matcher = pattern.matcher(phone);
            b = matcher.matches();
        }
        return b;
    }

}
